<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Satellite: Satellite/Satellite.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="LASAR Logo.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Satellite
   &#160;<span id="projectnumber">Revision 55</span>
   </div>
   <div id="projectbrief">Embedded AC Light Control and Bluetooth</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Satellite/Satellite.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_satellite_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Satellite.h</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Created: 3/13/2012 4:10:24 PM</span>
<a name="l00005"></a>00005 <span class="comment"> *  Author: Chris Williams</span>
<a name="l00006"></a>00006 <span class="comment"> */</span> 
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 
<a name="l00009"></a>00009 <span class="preprocessor">#ifndef SATELLITE_H_</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define SATELLITE_H_</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span>
<a name="l00012"></a><a class="code" href="_satellite_8h.html#ad72dbcf6d0153db1b8d8a58001feed83">00012</a> <span class="preprocessor">#define DEBUG 0</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span>
<a name="l00014"></a>00014 <span class="comment">//Servo Constants</span>
<a name="l00015"></a><a class="code" href="_satellite_8h.html#afb004735ca38de9210e8b8e9e84fcacb">00015</a> <span class="preprocessor">#define SERVO_PERIOD    312</span>
<a name="l00016"></a><a class="code" href="_satellite_8h.html#a496d0a0c60b8d9cb6f759577c310f217">00016</a> <span class="preprocessor"></span><span class="preprocessor">#define SERVO_FWD 0x0A  //1ms</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="comment">//#define SERVO_CEN 23  //1.5ms (not needed)</span>
<a name="l00018"></a><a class="code" href="_satellite_8h.html#a8c35450502e6060e9b1617139e745883">00018</a> <span class="preprocessor">#define SERVO_REV 0x2F  //2ms</span>
<a name="l00019"></a><a class="code" href="_satellite_8h.html#a1f1b7bda7db3f5e87e41ea51d048224c">00019</a> <span class="preprocessor"></span><span class="preprocessor">#define CLOSE_TIME 7000</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a><a class="code" href="struct_pref.html">00021</a>  <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00022"></a>00022 {
<a name="l00023"></a><a class="code" href="struct_pref.html#ae5af4ff48939d13d480f87e56a9385d6">00023</a>     uint8_t <a class="code" href="struct_pref.html#ae5af4ff48939d13d480f87e56a9385d6">hour</a>;
<a name="l00024"></a><a class="code" href="struct_pref.html#ac9b481208b43f7c37ed25e446bdec692">00024</a>     uint8_t <a class="code" href="struct_pref.html#ac9b481208b43f7c37ed25e446bdec692">min</a>;
<a name="l00025"></a><a class="code" href="struct_pref.html#acd6b0c9d182822b4646f744da608eb78">00025</a>         uint8_t <a class="code" href="struct_pref.html#acd6b0c9d182822b4646f744da608eb78">dim</a>;
<a name="l00026"></a><a class="code" href="struct_pref.html#ad1733fa682379b1821f819f56447c66a">00026</a>         uint8_t <a class="code" href="struct_pref.html#ad1733fa682379b1821f819f56447c66a">blinds</a>;
<a name="l00027"></a>00027 } <a class="code" href="struct_pref.html">Pref</a>;
<a name="l00028"></a>00028 
<a name="l00029"></a><a class="code" href="struct_time.html">00029</a>  <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00030"></a>00030 {
<a name="l00031"></a><a class="code" href="struct_time.html#ae5af4ff48939d13d480f87e56a9385d6">00031</a>     uint8_t <a class="code" href="struct_time.html#ae5af4ff48939d13d480f87e56a9385d6">hour</a>;
<a name="l00032"></a><a class="code" href="struct_time.html#ac9b481208b43f7c37ed25e446bdec692">00032</a>     uint8_t <a class="code" href="struct_time.html#ac9b481208b43f7c37ed25e446bdec692">min</a>;
<a name="l00033"></a>00033 } <a class="code" href="struct_time.html">Time</a>;
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="comment">//Function headers</span>
<a name="l00039"></a>00039 <span class="keywordtype">void</span> <span class="keyword">static</span> <span class="keyword">inline</span> delay_ms(uint16_t <a class="code" href="_light_controller_8c.html#af51b27b42d1da1194dde8fc35acfb378">tick</a>);
<a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="_satellite_8c.html#af0309a165c5eb3e860fd75ce362b8529">initAC</a>(<span class="keywordtype">int</span> dutycycle);
<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="_satellite_8c.html#a2f78b3f3318ab9a0a24a164f24256268">initL2F</a>();
<a name="l00042"></a>00042 <span class="keywordtype">void</span> <a class="code" href="_satellite_8c.html#a228ca26c149b48d0fa6a9e3c2c7975d0">initPIR</a>();
<a name="l00043"></a>00043 <span class="keywordtype">void</span> <a class="code" href="_satellite_8c.html#a1f576ee1d06e908fc16330a4506780a9">checkAlarm</a>();
<a name="l00044"></a>00044 <span class="keywordtype">void</span> <a class="code" href="_satellite_8c.html#a3f325a8aec708de6a186e6268f38d045">setDim</a>( <span class="keywordtype">int</span> arg );
<a name="l00045"></a>00045 <span class="keywordtype">void</span> <a class="code" href="_satellite_8c.html#a7fbfa2cedde30ed04396cc0a3f232f59">setBlinds</a>( <span class="keywordtype">int</span> arg );
<a name="l00046"></a>00046 <span class="keywordtype">void</span> <a class="code" href="_satellite_8c.html#ac3f87e7d8ba1b0dbacfd1bc1674cb92c">checkPIR</a>();
<a name="l00047"></a>00047 <span class="keywordtype">void</span> <a class="code" href="_satellite_8c.html#a7f03a61277bace0b0331e42497e0b69c">initServo</a>();
<a name="l00048"></a>00048 <span class="keywordtype">void</span> <a class="code" href="_satellite_8h.html#a065adbd131fc5f61263a53739d642766">initTimer</a>( <span class="keywordtype">int</span> dutycycle);
<a name="l00049"></a>00049 <span class="keywordtype">void</span> <span class="keyword">static</span> <span class="keyword">inline</span> varyBlinds(int8_t percent);  <span class="comment">//inline ensures function execution time optimization</span>
<a name="l00050"></a>00050 <span class="keywordtype">void</span> <a class="code" href="_satellite_8h.html#afd9b09f58917f0e2d14c61b956eba214">SPI_init</a>(<span class="keywordtype">void</span>);
<a name="l00051"></a>00051 <span class="keywordtype">char</span> <a class="code" href="_satellite_8h.html#ae7e64ca53a04fe609757c9260dc3791d">SPI_Transmit</a>(<span class="keywordtype">char</span> cData);
<a name="l00052"></a>00052 <span class="keywordtype">void</span> <a class="code" href="_satellite_8h.html#a478a022a994b38488f713e1a30107b70">getTime</a>(uint8_t * hours, uint8_t * minutes, uint8_t * seconds);
<a name="l00053"></a>00053 uint8_t <a class="code" href="_satellite_8c.html#a11e0fd7642e9f27565483c004bfbadd7">getDigits</a>(<span class="keywordtype">char</span> * cmd, uint8_t * <a class="code" href="_light_controller_8c.html#af27e3188294c2df66d975b74a09c001d">i</a>);
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 
<a name="l00056"></a>00056 
<a name="l00057"></a>00057 
<a name="l00058"></a>00058 <span class="comment">//AC Values</span>
<a name="l00059"></a><a class="code" href="_satellite_8h.html#a392fb874e547e582e9c66a08a1f23326">00059</a> <span class="preprocessor">#define MAX 25</span>
<a name="l00060"></a><a class="code" href="_satellite_8h.html#a29e413f6725b2ba32d165ffaa35b01e5">00060</a> <span class="preprocessor"></span><span class="preprocessor">#define OFF -1</span>
<a name="l00061"></a>00061 <span class="preprocessor"></span>
<a name="l00062"></a>00062 
<a name="l00063"></a>00063 
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 <span class="preprocessor">#endif </span><span class="comment">/* SATELLITE_H_ */</span>
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 19 2012 16:20:24 for Satellite by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
